home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 42
/
Amiga Format AFCD42 (Issue 126, Aug 1999).iso
/
-serious-
/
programming
/
other
/
jikes
/
src
/
unicode.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-05-14
|
2KB
|
88 lines
// $Id: unicode.h,v 1.3 1999/01/25 20:00:32 shields Exp $
//
// This software is subject to the terms of the IBM Jikes Compiler
// License Agreement available at the following URL:
// http://www.ibm.com/research/jikes.
// Copyright (C) 1996, 1998, International Business Machines Corporation
// and others. All Rights Reserved.
// You must accept the terms of that agreement to use this software.
//
#ifndef unicode_INCLUDED
#define unicode_INCLUDED
#include "config.h"
#include <iostream.h>
#ifndef __amigaos__
#include <wchar.h>
#endif
#include <ctype.h>
#include "bool.h"
#include "code.h"
#include "case.h"
class Unicode
{
public:
static inline void Cout(wchar_t ch)
{
#ifdef EBCDIC
cout << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' ');
#else
cout << (char) (ch > 0 && ch < 0x00C0 ? ch : ' ');
#endif
}
static inline void Cout(wchar_t *str)
{
for (; *str; str++)
Cout(*str);
}
static inline void Cerr(wchar_t ch)
{
#ifdef EBCDIC
cerr << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' ');
#else
cerr << (char) (ch > 0 && ch < 0x00C0 ? ch : ' ');
#endif
}
static inline void Cerr(wchar_t *str)
{
for (; *str; str++)
Cerr(*str);
}
static inline void Cout(char ch)
{
#ifdef EBCDIC
cout << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' ');
#else
cout << (char) (ch > 0 && ch < 0x00C0 ? ch : ' ');
#endif
}
static inline void Cout(char *str)
{
for (; *str; str++)
Cout(*str);
}
static inline void Cerr(char ch)
{
#ifdef EBCDIC
cerr << (char) (ch > 0 && ch < 0x00C0 ? Code::ToEBCDIC(ch) : ' ');
#else
cerr << (char) (ch > 0 && ch < 0x00C0 ? ch : ' ');
#endif
}
static inline void Cerr(char *str)
{
for (; *str; str++)
Cerr(*str);
}
};
#endif